package edu.hawaii.teams.halealohacli.processor;

import org.wattdepot.client.WattDepotClient;

/**
 * Test of the Processor class to determine if it does work in conjunction with Command. Note that
 * this is a manual test; it prints text to the screen and the developer must determine whether or
 * not this is "good" output. Automated testing is difficult at this moment because the actual
 * output is handled within the Processor class, thus all of the methods return void and testing the
 * return values does not work.
 * 
 * @author Branden Ogata
 * @author Jason Yeo
 * 
 */
public class ManualTestProcessor {

  /**
   * Checks each of the expected commands that implement Command. Note that any test dates must come
   * after the server reset on 23 November 2011 (technically 22 November 2011, but the first full
   * day of data is 23 November).
   * 
   * @param args Command line arguments, of which there should be none.
   * @throws Exception Handles any errors that do occur.
   * 
   */
  public static void main(String[] args) throws Exception {
    Processor processor =
        new Processor(new WattDepotClient("http://server.wattdepot.org:8190/wattdepot/"));

    // Test current-power
    System.out.println("Testing current-power");
    // Valid input
    processor.parseCurrentPower("current-power Ilima");

    // Test daily-energy
    System.out.println("\n\nTesting daily-energy");
    // Valid input
    processor.parseDailyEnergy("daily-energy Ilima 2011-11-23");

    // Test energy-since
    System.out.println("\n\nTesting energy-since");
    // Valid input
    processor.parseEnergySince("energy-since Ilima 2011-11-23");

    // Test rank-towers
    System.out.println("\n\nTesting rank-towers");
    // Valid input
    processor.parseRankTowers("rank-towers 2011-11-23 2011-11-24");

    // Invalid input
    processor.parseCurrentPower("current-power Alpha");
    processor.parseDailyEnergy("daily-energy Beta 2011-11-23");
    processor.parseEnergySince("energy-since Gamma 2011-11-23");
    processor.parseRankTowers("rank-towers yyyy-mm-dd yyyy-mm-dd");
  }
}